// ~/server/mysql.ts
import mysql from 'mysql2/promise';

let connection: mysql.Connection;
(async () => {
  // 创建 MySQL 连接  
  connection = await mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: '123456',
    database: 'nuxt-data',
  });
})()

// @ts-ignore
export default connection;